---
title: Migrating to 2.0
description: Migrate to Apollo Android 2.0
---

### Kotlin Multiplatform

We are really excited to announce that with this release it is possible to build Kotlin Multiplatform apps with Apollo. The supported
targets are Android / iOS / JVM.

Please check-out `samples/multiplatform` for sample application.

This is a backward compatible change for existing users. Please keep in mind that it will bring Kotlin standard library as a transitive
dependency.

Side effect changes of Kotlin migration:
- Some primitive types like `Boolean`s may be unboxed where appropriate
- Classes and functions are `final` unless they are intentionally marked as `open`
- Kotlin-stdlib is added as a transitive dependency
- Jvm target version is now 1.8. See the [Android Developer website](https://developer.android.com/studio/write/java8-support#supported_features) for details on how to enable it in yout project.

### Okio migration

Okio has been updated to [2.4.3](https://github.com/square/okio/blob/main/CHANGELOG.md#version-230) for Kotlin multiplatform.

The new version of okio is binary compatible. There are some source incompatible changes for Kotlin users like Java static function being moved to Kotlin extension functions.

If you explicitly depend okio, it is recommended to do a major version upgrade before upgrading Apollo.

**Note:** while we initially considered upgrading Okhttp to version 4.x, we ultimately reverted the change to keep compatibility with Android 4.4. More details in [#2054](https://github.com/apollographql/apollo-android/pull/2054) and [2269](https://github.com/apollographql/apollo-android/pull/2269).

### New Normalized Cache Modules

For in-memory `LruNormalizedCache` users, no change required since `apollo-runtime` brings it as transitive dependency. It is still
recommended adding the following dependency explicitly: `implementation("com.apollographql.apollo3:apollo-normalized-cache:x.y.z")`

> Apollo normalized cache module ([#2142](https://github.com/apollographql/apollo-android/pull/2142))

`SqlNormalizedCache` is moved to its own module. If you added `apollo-android-support` for disk cache, replace it with new dependency.

```kotlin title="build.gradle"
// Replace:
implementation("com.apollographql.apollo3:deprecated-apollo-android-support:x.y.z")

// With:
implementation("com.apollographql.apollo3:apollo-normalized-cache-sqlite:x.y.z") // highlight-line
```

`ApolloSqlHelper` is deprecated. Instantiate `SqlNormalizedCacheFactory` with same arguments instead.

<MultiCodeBlock>

```kotlin
// Replace:
val apolloSqlHelper = ApolloSqlHelper.create(context, "db_name");
val cacheFactory = SqlNormalizedCacheFactory(apolloSqlHelper);

// With:
val cacheFactory = SqlNormalizedCacheFactory(context, "db_name"); // highlight-line
```

```java
// Replace:
ApolloSqlHelper apolloSqlHelper = ApolloSqlHelper.create(context, "db_name");
NormalizedCacheFactory cacheFactory = new SqlNormalizedCacheFactory(apolloSqlHelper);

// With:
NormalizedCacheFactory cacheFactory = new SqlNormalizedCacheFactory(context, "db_name"); // highlight-line
```

</MultiCodeBlock>

> Replace legacy Android SQL with SqlDelight ([#2158](https://github.com/apollographql/apollo-android/pull/2158))

### Deprecated Gradle Plugin

The deprecated Gradle Plugin is now removed. Please refer to [the migration guide](./1.3/#gradle-plugin-changes) from previous releases before upgrading to 2.0.

